package com.personnel_management.service.impl;

import com.personnel_management.dao.AnnounDao;
import com.personnel_management.pojo.Announcement;
import com.personnel_management.service.AnnounService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.List;
@Service
public class AnnounServiceImpl implements AnnounService {
    @Autowired
    private AnnounDao dao;


    @Override
    public Integer addAnnoun(Announcement a) {
        a.setStarttime(new Timestamp(System.currentTimeMillis()));
        return dao.addAnnoun(a);
    }

    @Override
    public List<Announcement> getAnnouns() {
        return dao.getAnnouns();
    }

    @Override
    public Integer setAnnounByid(Announcement a) {
        return dao.setAnnounByid(a);
    }

    @Override
    public Integer deleteAnnoun(Integer id) {
        return dao.deleteAnnoun(id);
    }
}
